import request from '../utils/request.js'

const FONT_PREFIX = '/front/address'

export default {
	/**
	 * 根据用户id查询地址信息
	 */
	getAddressById(memberID) {
		return request({
			url: `${FONT_PREFIX}/getById/${memberID}`,
			method: 'get'
		})
	},

	/**
	 * 新增地址
	 * @param {Object} address
	 */
	addAddress(address) {
		return request({
			url: `${FONT_PREFIX}/addAddress`,
			data: address,
			method: 'post'
		})
	},
	/**
	 * 根据地址id修改地址
	 */
	updateAddressById(addressData) {
		return request({
			url: `${FONT_PREFIX}/updateAddress`,
			method: 'post',
			data: addressData
		})
	}
}
